//
//  ViewController.swift
//  ArrayCopy
//
//  Created by ZhangBo on 2017/5/8.
//  Copyright © 2017年 ZhangBo. All rights reserved.
//

import UIKit

struct Person {
    var name: String?
    var age: Int?
}

class ViewController: UIViewController {
    
    var personArray: Array<Person>!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        var p1 : Person = Person()
        p1.name = "zhang san"
        p1.age = 18
        
        var p2 : Person  = Person()
        p2.name = "li si"
        p2.age = 19
        
        let person1 :[Person] = [p1,p2]
        
        self.personArray = person1;
        self.personArray[0].name = "wang wu"
        self.personArray[1].name = "zhao liu"
        print("\(String(describing: person1[0].name))") // zhang san
        print("\(String(describing: person1[1].name))") // li si

    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}

